package vn.edu.ptithcm.pim.util;

import java.util.ArrayList;
import java.util.List;

import vn.edu.ptithcm.pim.constant.TaskStatuses;

public class TaskStatusUtil {
	private static final long[] statuses = { TaskStatuses.NEW,
			TaskStatuses.ASSIGNED, TaskStatuses.CONFIRMED,
			TaskStatuses.FEEDBACK, TaskStatuses.PENDING,
			TaskStatuses.TOBE_REVIEWED, TaskStatuses.RESOLVED,
			TaskStatuses.CLOSED };

	public static List<Long> getDependencyStatusesForHiding(int status) {
		List<Long> results = new ArrayList<Long>();
		if (status >= 1 && status <= statuses.length) {
			for (int i = status; i <= statuses.length; ++i) {
				results.add(statuses[i - 1]);
			}
		}
		return results;
	}

	public static List<Long> getDependencyStatusesForShowing(int status) {
		List<Long> results = new ArrayList<Long>();
		if (status >= 1 && status <= statuses.length) {
			for (int i = 0; i < status; ++i) {
				results.add(statuses[i]);
			}
		}
		return results;
	}
}
